<include file="public@header" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/bootstrap-grid.min.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/zoomify.min.css">
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('Goods/index')}">品项列表</a></li>
			<li><a href="{:url('Goods/add')}">新增品项</a></li>
		</ul>
		<form class="well form-inline margin-top-20" method="post" action="{:url('Goods/index')}">
            商品名:
         <input type="text" class="form-control" name="g_goodsname" style="width: 120px;" value="{:input('request.g_goodsname/s','')}" placeholder="请输入商品名">
            拼音简码:
         <input type="text" class="form-control" name="g_code" style="width: 120px;" value="{:input('request.g_code/s','')}" placeholder="拼音简码">
         <input type="submit" class="btn btn-primary" value="搜索" />
         <a class="btn btn-danger" href="{:url('Goods/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr><span style="color:#0066FF;font-size: 15px;">*商品规格必须填写*</span></tr>
				<tr>
					<th width="40">ID</th>
					<!-- <th align="left">品项编号</th> -->
					<th align="left">品项名称</th>
					<th align="left">品项单位</th>
					<th align="left">拼音简码</th>
					<th align="left">所属类别</th>
					<th align="left">添加时间</th>
					<th align="left">修改时间</th>
					<!-- <th align="left">套餐</th>
					<th align="left">折扣</th>
					<th align="left">时价</th> -->
					<th align="left">图片</th>
					<th width="160">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="data" item="vo">				
				<tr>
					<td>{$vo.g_id}</td>
					<!-- <td>{$vo.g_encrypt}</td> -->
					<td>{$vo.g_goodsname}</td>
					<td>{$vo['g_unit']|getUname}</td>
					<td>{$vo.g_code}</td>
					<td>{$vo['g_category']|getCname}</td>
					<td>{$vo.g_ctime|time_format}</td>
					<td>{$vo.g_utime||time_format}</td>
					<!-- <td>{$vo.g_meal|get_kg}</td>
					<td>{$vo.g_agio|get_kg}</td>
					<td>{$vo.g_nowprice|get_kg}</td> -->
					<td>
						<div class="example col-xs-6 col-md-6">
						<p><img src="__ROOT__/upload/{$vo.g_pic}" class="img-rounded" alt="" width='50' height='50'></p>
						</div>
					</td>
					<td>
						<if condition="$vo['g_status'] eq 1">
                            <a class="js-ajax-dialog-btn"
                               href="{:url('Goods/upStatus',['g_id'=>$vo['g_id'],'g_status'=>0])}">禁用</a>
                            <else/>
                            <a class="js-ajax-dialog-btn"
                               href="{:url('Goods/upStatus',['g_id'=>$vo['g_id'] ,'g_status'=>1])}">启用</a>
                         </if>
						<a href="{:url('Goods/edit',array('g_id'=>$vo['g_id']))}">{:lang('EDIT')}</a>
						<a class="js-ajax-delete" href="{:url('Goods/delete',array('g_id'=>$vo['g_id']))}">{:lang('DELETE')}</a>
						<a href="javascript:parent.openIframeLayer('{:url('Format/index',array('pid'=>$vo['g_id']))}',{});">规格</a>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__TMPL__/public/assets/js/zoomify.min.js"></script>
	<script type="text/javascript">
		$('.example img').zoomify();
	</script>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>